<template>
  <el-dialog
    :model-value="show"
    title="添加时间段"
    style="width: 420px"
    @close="emit('HiddenFn')"
  >
    <el-form :model="form">
      <el-form-item label="秒杀时间段名称：">
        <el-input v-model="form.name" />
      </el-form-item>
      <el-form-item label="每日开始时间：">
        <el-time-picker
          v-model="form.startTime"
          placeholder="请选择时间"
          style="text-indent: 1em"
        />
      </el-form-item>
      <el-form-item label="每日结束时间：">
        <el-time-picker
          v-model="form.endTime"
          placeholder="请选择时间"
          style="text-indent: 1em"
        />
      </el-form-item>
      <el-form-item label="是否启用" style="padding-left: 36px">
        <el-radio-group v-model="form.status" class="ml-4">
          <el-radio :label="1">启用</el-radio>
          <el-radio :label="0">不启用</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button>取消</el-button>
        <el-button type="primary"> 确定 </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref, reactive } from "vue";
import { addFlashSession } from "./api";
const props = defineProps({
  show: {
    type: Boolean,
    default: false,
  },
});
const emit = defineEmits(["HiddenFn"]);
const form = reactive<IFlashSession>({
  id: 0,
  name: "",
  startTime: "",
  endTime: "",
  status: 0,
  createTime: "",
});
// addFlashSession(form);
</script>

<style lang="scss" scoped></style>
